package routers

import (
	"beego_demo/controllers"
	"github.com/astaxie/beego"
)

func init() {
	beego.Router("/", &controllers.MainController{})
	//测试路由
	beego.Router("/getDemo", &controllers.DemoController{}, "get:GetDemo")
	beego.Router("/postDemo", &controllers.DemoController{}, "post:PostDemo")
	beego.Router("/demo", &controllers.DemoController{}, "get:GetDemo;post:PostDemo")
	beego.Router("/doDemo", &controllers.DemoController{}, "get,post:DoDemo")
	//测试参数获取
	beego.Router("/testParam", &controllers.ParamController{}, "*:TestParam")
	beego.Router("/parseParamToStruct", &controllers.ParamController{}, "*:ParseParamToStruct")
	beego.Router("/readRequestBody", &controllers.ParamController{}, "*:ReadRequestBody")
	beego.Router("/getUploadFile", &controllers.ParamController{}, "*:GetUploadFile")
	//测试json返回
	beego.Router("/jsonReturn", &controllers.JsonReturnController{}, "*:JsonReturn")

}
